﻿@model sipfe.model.dataAccess.SIPMaePersona
@{   
    int k = 0;
    List<sipfe.model.dataAccess.SIPDetCorreo> correos;  
}
@if (Model.SIPDetCorreo.Count > 0)
{
    <div class="divOver7">
    <table class="Reporte1">
        <thead>
            <tr>
                <th>#</th>
                <th>Correo electrónico</th>
                <th>Inicio Vig.</th>
                <th>Fin Vig.</th>
                <th>Usu. Registro</th>
                <th>Fecha Registro</th>
            </tr>
        </thead>
        @{
            correos = Model.SIPDetCorreo.OrderByDescending(o => o.nIdeCorreo).ToList();
            foreach (sipfe.model.dataAccess.SIPDetCorreo itemAux in correos)
            {
                k++;
                    <tr class="@(k % 2 != 0 ? "odd" : "even")">
                        <td>@k</td>
                        <td>@itemAux.vCorreo</td>
                        <td>@String.Format("{0:dd/MM/yyyy}", itemAux.dFecIniVig)</td>
                        <td>
                            @if (@itemAux.dFecFinVig.ToString().Length <= 0)
                            {               
                                <span><span class="letraLink8R" onclick="javascript:cerrarVigenciaItem(this,'@itemAux.nIdeCorreo','correo');">CERRAR VIGENCIA</span></span>
                            }
                            else
                            {
                                @String.Format("{0:dd/MM/yyyy}", itemAux.dFecFinVig);
                            }
                        </td>
                        <td>@itemAux.SIPMaeUsuario.vCodUsuario</td>
                        <td>@String.Format("{0:dd/MM/yyyy HH:mm}", itemAux.dFecReg)</td>
                    </tr>
            }
        }
    </table>
    </div>
}else{
    @RenderPage("~/Areas/Persona/Views/Shared/SinRegistros.cshtml")
}